package level.model;

import level.editor.control.tile.TileConstants;

public class Tile implements Addable
{
	public Tile()
	{
		iconPath = null;
		x = 0;
		y = 0;
		w = (int) TileConstants.TILE_SIZE;
		h = (int) TileConstants.TILE_SIZE;
		sx = 0;
		sy = 0;
		sw = (int) TileConstants.TILE_SIZE;
		sh = (int) TileConstants.TILE_SIZE;
	}

	public boolean equals(Addable addable)
	{
		Tile tile = (Tile) addable;
		if (x == tile.getX() && y == tile.getY() && w == tile.getW()
				&& h == tile.getH() && sx == tile.getSx() && sy == tile.getSy()
				&& sw == tile.getSw() && sh == tile.getSh()
				&& iconPath.equals(tile.getIconPath()))
		{
			return true;
		}
		else
			return false;
	}
	
	public Addable cloneAddable()
	{
		return cloneTile();
	}

	public Tile cloneTile()
	{
		Tile ti = new Tile();
		ti.setX(this.x);
		ti.setY(this.y);
		ti.setW(this.w);
		ti.setH(this.h);
		ti.setSx(this.sx);
		ti.setSy(this.sy);
		ti.setSw(this.sw);
		ti.setSh(this.sh);
		ti.setIconPath(this.iconPath);
		return ti;
	}

	public String getIconPath()
	{
		return iconPath;
	}

	public void setIconPath(String iconPath)
	{
		this.iconPath = iconPath;
	}

	public int getX()
	{
		return x;
	}

	public void setX(int x)
	{
		this.x = x;
	}

	public int getY()
	{
		return y;
	}

	public void setY(int y)
	{
		this.y = y;
	}

	public int getW()
	{
		return w;
	}

	public void setW(int w)
	{
		this.w = w;
	}

	public int getH()
	{
		return h;
	}

	public void setH(int h)
	{
		this.h = h;
	}

	public int getSx()
	{
		return sx;
	}

	public void setSx(int sx)
	{
		this.sx = sx;
	}

	public int getSy()
	{
		return sy;
	}

	public void setSy(int sy)
	{
		this.sy = sy;
	}

	public int getSw()
	{
		return sw;
	}

	public void setSw(int sw)
	{
		this.sw = sw;
	}

	public int getSh()
	{
		return sh;
	}

	public void setSh(int sh)
	{
		this.sh = sh;
	}

	private String iconPath;
	private int x;
	private int y;
	private int w;
	private int h;
	private int sx;
	private int sy;
	private int sw;
	private int sh;

}
